<cfcomponent extends="TracRpcAdapterAbstractTest">

	<cffunction name="testGetAPIVersion" returntype="void" access="public">
		<cfset var params = structNew()>
		<cfset var results = variables.tracRpcAdapter.runMethod(1,"system.getAPIVersion",params)>
	  <cfset var version = arrayNew(1)>
	  <cfset var rpcCall = "">
	  <cfset version[1] = "$int1">
	  <cfset version[2] = "$int1">
	  <cfset v = arrayNew(1) />
	  <cfset v[1]=version />
		<cfset assertEquals(expected=v,actual=results,message="Get API Failed") />
	</cffunction>

	<cffunction name="testGetProjectNames" returntype="void" access="public">
		<cfset var results = variables.tracRpcAdapter.runMethod(1,"project.getAll")>
		<cfset assertComplexValue(value=results) />
	</cffunction>

	<cffunction name="testGetProjectComponentNames" returntype="void" access="public">
		<cfset var params = structNew()>
		<cfset var results = "" />
		<cfset params["projectID"] = 1>
		<cfset results = variables.tracRpcAdapter.runMethod(1,"project.component.getAll",params)>
		<cfset assertComplexValue(value=results) />
	</cffunction>

	<cffunction name="testGetProjectMilestoneNames" returntype="void" access="public">
		<cfset var params = structNew()>
		<cfset var results = "" />
		<cfset params["projectID"] = 1>
		<cfset results = variables.tracRpcAdapter.runMethod(1,"project.milestone.getAll",params)>
<!---
 		<cfdump var="#xmlparse(CFML2XMLRPC(results,"response"))#"><cfabort />
 --->
		<cfset assertComplexValue(value=results) />
	</cffunction>

	<cffunction name="testGetProjectMilestone" returntype="void" access="public">
		<cfset var params = structNew()>
		<cfset var results = "" />
		<cfset params["projectID"] = variables.projectId />
		<cfset params["milestoneName"] = "milestone one" />
		<cfset results = variables.tracRpcAdapter.runMethod(1,"project.milestone.get",params) />
		<cfset assertEquals(value,results) />
	</cffunction>

	<cffunction name="testGetProjectMilestoneMultiCall" returntype="void" access="public">
		<cfset var params = structNew()>
		<cfset var results = "" />
		<cfset rpcCall = XMLRPC2CFML(data= '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>system.multicall</methodName><params><param><value><array><data><value><struct><member><name>params</name><value><array><data><value>milestone one</value></data></array></value></member><member><name>methodName</name><value>ticket.milestone.get</value></member></struct></value><value><struct><member><name>params</name><value><array><data><value>milestone two</value></data></array></value></member><member><name>methodName</name><value>ticket.milestone.get</value></member></struct></value><value><struct><member><name>params</name><value><array><data><value>milestone3</value></data></array></value></member><member><name>methodName</name><value>ticket.milestone.get</value></member></struct></value><value><struct><member><name>params</name><value><array><data><value>milestone4</value></data></array></value></member><member><name>methodName</name><value>ticket.milestone.get</value></member></struct></value></data></array></value></param></params></methodCall>') />
		<cfset results = variables.tracRpcAdapter.runMethod(1,"system.multicall",rpcCall["params"][1]) />
		<cfset results = xmlparse(CFML2XMLRPC(results,"response")) />
		<cfset assertComplexValue(value=results) />
	</cffunction>
				
</cfcomponent>